﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using QD.Snapshot.Core.Form;
using QD.Snapshot.Core.Config;
using QD.Snapshot.Core.BLL.File;

namespace QD.Snapshot.File
{
    public partial class Form1 : FormBase
    {
        List<Thread> listThread = new List<Thread>();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            SiteConfig.Init();  //加载配置
            Template.Init();    //加载模板
            Work.Begin(textBox1);
            timer1.Start();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            timer1.Stop();
            AbortThread(listThread);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            //1分钟刷新剩余数量
            lblNum.Text = string.Format("{0} 个", Snap.GetCount());
        }
    }
}